package com.example.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.backend.entity.User;
import com.example.backend.entity.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 李月
 * @date 2022/4/13 20:45
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT * from tb_user WHERE tb_user.phone_number =#{phoneNumber}")
    User getInformation(String phoneNumber);
    @Select("SELECT tb_user.user_id AS userID,tb_user.nickname AS nickName,tb_user.phone_number AS phoneNumber FROM tb_user")
    List<UserVO> getUser(Page<UserVO> page);
}
